package cn.jn.lhm.teacher.handler;

import cn.jn.lhm.utils.R;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * @author LHM
 * @Tips 热爱每一天，奋斗每一天
 * @date 2020/5/29 - 7:32
 */
@RestController
@Slf4j
@RequestMapping("/admin")
public class AdminLoginHandler {


    @PostMapping("/login")
    public R login(@RequestBody Map<String,Object> map){
        log.info("获取到的信息为" + map.get("username") + map.get("password"));
        return R.ok().data("token", "admin");
    }

    @GetMapping("/user/info")
    public R info(){
        return R.ok().data("name", "admin").data("avatar", "https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif")
                .data("roles","admin");
    }

}
